package com.alex.space.commons.date.expression;

import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.Setter;

import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * @author Alex
 *         Created by Alex on 2017/12/21.
 */
@Getter
@Setter
@AllArgsConstructor
public class DateModel {

    private Date start;

    private Date end;

    public DateModel() {
        this.start = new Date();
        this.end = new Date();
    }

    @Override
    public String toString() {
        SimpleDateFormat sdf = new SimpleDateFormat(" yyyy-MM-dd ");
        return String.format("%s~%s", sdf.format(start), sdf.format(end));
    }
}
